package com.duowei.diandan.bean;

import com.duowei.diandan.sql.ColumnName;
import com.duowei.diandan.sql.InsertField;
import com.duowei.diandan.sql.TableName;

import org.joda.time.LocalDateTime;

/**
 * 会员卡充值消费明细
 */
@TableName(name = "ims_card_deal_record")
public class ImsCardDealRecord {

    //private Integer id; // int(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT,

    @InsertField
    private Integer weid; // int(10) NOT NULL,
    @InsertField
    @ColumnName(name = "from_user")
    private String fromUser; // varchar(50) NOT NULL,
    @InsertField
    private LocalDateTime jysj; // datetime NOT NULL COMMENT '交易时间',
    @InsertField
    private String jylx; // varchar(20) NOT NULL COMMENT '交易类型',
    @InsertField
    private Float czqje; // decimal(10,2) NOT NULL COMMENT '操作前金额',
    @InsertField
    private Float kczje; // decimal(10,2) NOT NULL COMMENT '操作金额',
    @InsertField
    private Float ssje = 0f; // decimal(10,2) NOT NULL COMMENT '实收金额',
    @InsertField
    private Float kye; // decimal(10,2) NOT NULL COMMENT '卡余额',
    @InsertField
    private String syjh; // varchar(200) NOT NULL COMMENT '收银机号',
    @InsertField
    private String yhmc; // varchar(50) NOT NULL COMMENT '操作人',
    @InsertField
    private String fkfs; // varchar(50) COMMENT '付款方式',
    @InsertField
    @ColumnName(name = "deal_id")
    private String dealId; // varchar(50) COMMENT '交易记录id',
    @InsertField
    private String bmbh; // varchar(10) DEFAULT '',
    @InsertField
    private String ddh; // varchar(100),
    @InsertField
    private String ddid; // varchar(100),
    @InsertField
    private String storeid; // varchar(100),
    @InsertField
    private String username; // varchar(200),
    @InsertField
    private String orderid; // varchar(255),
    @InsertField
    private String oldcardsn; // varchar(20),
    @InsertField
    private String clzt; // varchar(2) DEFAULT '0',
    @InsertField
    private Integer uid; // int(10) DEFAULT '0',
    @InsertField
    private String bjje; // decimal(10,2) COMMENT '本金金额',
    @InsertField
    private String zsje; // decimal(10,2) COMMENT '赠送金额',
    @InsertField
    private String bjbl; // decimal(18,6) COMMENT '本金占比',
    @InsertField
    private String sfjs; // varchar(2) COMMENT '是否结算',
    @InsertField
    private String remark; // varchar(100) COMMENT '备注'

    public ImsCardDealRecord() {
    }

    public Integer getWeid() {
        return weid;
    }

    public void setWeid(Integer weid) {
        this.weid = weid;
    }

    public String getFromUser() {
        return fromUser;
    }

    public void setFromUser(String fromUser) {
        this.fromUser = fromUser;
    }

    public LocalDateTime getJysj() {
        return jysj;
    }

    public void setJysj(LocalDateTime jysj) {
        this.jysj = jysj;
    }

    public String getJylx() {
        return jylx;
    }

    public void setJylx(String jylx) {
        this.jylx = jylx;
    }

    public Float getCzqje() {
        return czqje;
    }

    public void setCzqje(Float czqje) {
        this.czqje = czqje;
    }

    public Float getKczje() {
        return kczje;
    }

    public void setKczje(Float kczje) {
        this.kczje = kczje;
    }

    public Float getSsje() {
        return ssje;
    }

    public void setSsje(Float ssje) {
        this.ssje = ssje;
    }

    public Float getKye() {
        return kye;
    }

    public void setKye(Float kye) {
        this.kye = kye;
    }

    public String getSyjh() {
        return syjh;
    }

    public void setSyjh(String syjh) {
        this.syjh = syjh;
    }

    public String getYhmc() {
        return yhmc;
    }

    public void setYhmc(String yhmc) {
        this.yhmc = yhmc;
    }

    public String getFkfs() {
        return fkfs;
    }

    public void setFkfs(String fkfs) {
        this.fkfs = fkfs;
    }

    public String getDealId() {
        return dealId;
    }

    public void setDealId(String dealId) {
        this.dealId = dealId;
    }

    public String getBmbh() {
        return bmbh;
    }

    public void setBmbh(String bmbh) {
        this.bmbh = bmbh;
    }

    public String getDdh() {
        return ddh;
    }

    public void setDdh(String ddh) {
        this.ddh = ddh;
    }

    public String getDdid() {
        return ddid;
    }

    public void setDdid(String ddid) {
        this.ddid = ddid;
    }

    public String getStoreid() {
        return storeid;
    }

    public void setStoreid(String storeid) {
        this.storeid = storeid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getOrderid() {
        return orderid;
    }

    public void setOrderid(String orderid) {
        this.orderid = orderid;
    }

    public String getOldcardsn() {
        return oldcardsn;
    }

    public void setOldcardsn(String oldcardsn) {
        this.oldcardsn = oldcardsn;
    }

    public String getClzt() {
        return clzt;
    }

    public void setClzt(String clzt) {
        this.clzt = clzt;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getBjje() {
        return bjje;
    }

    public void setBjje(String bjje) {
        this.bjje = bjje;
    }

    public String getZsje() {
        return zsje;
    }

    public void setZsje(String zsje) {
        this.zsje = zsje;
    }

    public String getBjbl() {
        return bjbl;
    }

    public void setBjbl(String bjbl) {
        this.bjbl = bjbl;
    }

    public String getSfjs() {
        return sfjs;
    }

    public void setSfjs(String sfjs) {
        this.sfjs = sfjs;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    /**
     * @param weid
     * @param fromUser
     * @param czqje    操作前金额
     * @param kczje    操作金额 (正负号)
     * @param syjh     收银机号 就是设备名
     * @param yhmc     操作人
     * @param bmbh     交易记录门店
     * @param dealId   交易记录id
     *//*
    public ImsCardDealRecord(int weid, String fromUser, String jysj, float czqje, float kczje, String syjh, String yhmc, String bmbh, String dealId) {
        this.weid = weid;
        this.fromUser = fromUser;
        this.jysj = jysj;
        this.czqje = czqje;
        this.kczje = kczje;
        this.syjh = syjh;
        this.yhmc = yhmc;
        this.bmbh = bmbh;
        this.dealId = dealId;

        this.kye = czqje + kczje; // 卡余额 = 操作前金额 + 操作金额
    }

    *//**
     * 例子：
     * insert into ims_card_deal_record (weid, from_user, JYSJ, JYLX, CZQJE, KCZJE, SSJE, KYE, SYJH, YHMC, bmbh, deal_id)
     * values (175, 'o1_uLv_KDKjZb3UTnhAQSxAYh2M0', '2017-02-14 09:57:35', 'ֵ', 83, -17, 0, 66, 'ZYB', '޿', 'djnr01', '6');
     *//*
    public String toInsertString() {
        return "insert into ims_card_deal_record (weid,          from_user,      JYSJ,      JYLX,             CZQJE,         KCZJE,    SSJE,  KYE,          SYJH,           YHMC,           bmbh,            deal_id)" +
                "                     values (" + weid + ", '" + fromUser + "', '" + jysj + "','储值卡消费', " + czqje + ", " + kczje + ", 0, " + kye + ", '" + syjh + "', '" + yhmc + "', '" + bmbh + "', '" + dealId + "')|";
    }*/
}
